home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Darth Fader 1.0 / source / df code ƒ / fade.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.5 KB  |  69 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        fade.c
  4.  
  5. Purpose:    This module handles calling the gamma routines to fade
  6.             the screen to black and back.
  7.             
  8.  
  9. Darth Fader -=- fade in and out on system beep
  10. Copyright (C) 1993 Mark Pilgrim
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "fade.h"
  30. #include "gamma.h"
  31. #include "msg timing.h"
  32. #include "init.h"
  33.  
  34. long            real_SysBeep;
  35.  
  36. void MySysBeep(void)
  37. {
  38.     int                i;
  39.     long            realtrap;
  40.     
  41.     SetUpA4();
  42.     SetupGammaTools();
  43.     
  44.     for (i=100; i>=0; i-=10)
  45.     {
  46.         StartTiming();
  47.         DoGammaFade(i);
  48.         TimeCorrection(1);
  49.     }
  50.     StartTiming();
  51.     TimeCorrection(10);
  52.     for (i=0; i<=100; i+=10)
  53.     {
  54.         StartTiming();
  55.         DoGammaFade(i);
  56.         TimeCorrection(1);
  57.     }
  58.     
  59.     DisposeGammaTools();
  60.  
  61.     realtrap = real_SysBeep;
  62.     RestoreA4();
  63.     asm {
  64.         movea.l        realtrap, a0
  65.         unlk        a6
  66.         jmp            (a0)
  67.     }
  68. }
  69.